<?php


namespace app\appa\validate;


use think\Validate;

class AppraValidate extends Validate
{
    protected $rule = [
        'id' => 'require',
        'members_name' => 'max:21',
        'text' => 'require|length:3',
//        'password' => 'require|min:6|max:32',
//        'money' => 'require',
    ];

    protected $message = [
        'name.requireIf' => '用户姓名不能为空',
        'name.max' => '用户姓名不能超过21个字符',
        'text.require' => '内容不能为空',
//        'age.length' => '年龄必须为3位',
//        'password.require' => '密码不能为空',
//        'password.min' => '密码长度不能小于6位',
//        'password.max' => '密码长度不能超过32位',
        'id.require' => 'id不能为空',
//        'money.require' => '钱不能为空',
    ];

    //验证场景
    protected $scene = [
        'add' => ['text'],
        'edit' => ['id'],
//        'login' => ['mobile'],
//        'addMoney' => ['money'],
//        'register' => ['mobile']
    ];




}